package palf.commands {
internal class MacroCommand implements Command {

	private var _commands : Vector.<Command> = new Vector.<Command>();

	public function MacroCommand() {
	}

	public function execute() : void {
		var command : Command;
		for each (command in _commands) {
			command.execute();
		}
	}

	public function addCommand(command : Command) : void {
		if (command != this) {
			_commands.push(command);
		} else {
			throw new CommandError("Cannot add Macro to itself");
		}
	}
}
}
